package Month07.day31;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

public class test4 {
    public static void main(String[] args) throws IOException {
        System.out.println("输入你的身份证");
        Scanner scanner = new Scanner(System.in);
        String num = scanner.next();
        String newNum = "";
        char[] chars = num.toCharArray();
        for (char Char : chars) {
            if ((int) Char % 2 == 0) {
                newNum += Char;
            }
        }
        System.out.println(newNum);
        File file = new File("D:\\Idea-Project\\basic\\basic\\code.txt");
        if (file.createNewFile()) {
            FileOutputStream fileOutputStream = new FileOutputStream(file);
            fileOutputStream.write(Integer.parseInt(newNum));
        }
    }
}
